<template>
  <div class="">
    <el-dialog
        :title="title"
        append-to-body
        @close="dialogClose"
        :visible.sync="visible"
        :fullscreen="true"
        v-bind.sync="$attrs">

      <TableForm :config="tableConfig"   ref="v2Table" :formData="formData"></TableForm>
    </el-dialog>
  </div>
</template>

<script>
import Dialog from "@/commons/Dialog";
import dictConfig from "./dictConfig"
import Service from "api/Service";
export default {
  name: "toolDictItem",
  mixins:[Dialog],
  props: {
    value: false,
    title: "" ,
    dictType: "",
    dictId: ""
  },
  data() {
    return {
      dictItemDialog: false ,
      formData:{} ,
      tableConfig:{
        url: `/${Service.itToolService}/toolDictItem/listByPage`,
        lazy: true ,
        method: 'post' ,
        columns: dictConfig.dictItemColumns,
        buttons: [
          {
            type: 'newAdd',
            method: 'post',
            url: `/${Service.itToolService}/toolDictItem/save`,
            title: '添加'
          },
        ],
        tableHead:{

        }
      }
    }
  },
  computed:{

  },
  watch:{
    value(v){
      if(v){
        this.$nextTick(()=>{
          this.formData.dictId = this.dictId
          this.formData.dictType = this.dictType
          this.$refs.v2Table.getFirst()
        })
      }
    }
  },
  methods:{
    addDictItem(){

    }
  }
}
</script>

<style scoped>

</style>